package com.anycl.design.behavioral.nullobject;

public class ObjectFactory {

    public static AbstractObject creator(final String name) {
        AbstractObject result;

        switch (name) {
            case "Java":
                result = new ConcreteObject("Java");
                break;
            case "MySQL":
                result = new ConcreteObject("MySQL");
                break;
            default:
                result = new NullObject();
                break;
        }

        return result;
    }
}
